/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package DAO;
import DTO.CHeThong;
import DTO.CFields;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
public class CHeThongDAO extends IData<CHeThong>{
    public CHeThongDAO(){
        
    }

    @Override
    public CHeThong add(CHeThong item) {
        throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
    }

    @Override
    protected void add(CHeThong item, int t) {
        throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
    }

    @Override
    public void saveBatch() {
        throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
    }

    @Override
    public int addrows(List<CHeThong> list, SubConfig config) {
        throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
    }

    @Override
    public CHeThong Find(CHeThong item, List<CHeThong> list) {
        throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
    }

    @Override
    protected Object OnSubmit(CHeThong item, int t, SubConfig config) {
        throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
    }

    @Override
    public Object insertOnSubmit(CHeThong item, SubConfig config) {
        throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
    }

    @Override
    public Object updateOnSubmint(CHeThong item, SubConfig config) {
        throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
    }

    @Override
    public Object deleteOnSubmint(CHeThong item, SubConfig config) {
        throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
    }

    @Override
    protected CHeThong getItem(ResultSet rs) {
        CHeThong item = new CHeThong();
        try {
            item.setId(rs.getLong(CFields.kho_id));
            item.setTenkho(rs.getString(CFields.ten_kho));
            item.setThanhtien(rs.getDouble(CFields.thanh_tien));
        } catch (SQLException ex) {
            Logger.getLogger(CHeThongDAO.class.getName()).log(Level.SEVERE, null, ex);
        }
        return item;
    }

    @Override
    public List<CHeThong> getAll(SubConfig config) {
        throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
    }
    
    public CHeThong getItem(List<CHeThong>list, long kho_id){
        for(CHeThong item : list){
            if(item.getId() == kho_id){
                return item;
            }
        }
        return null;
    }
    
}
